package com.easy.framework.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * TreeSelect树结构实体类
 *
 * @author Easy
 */
@Setter
@Getter
public class TreeModel implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 节点ID
     */
    private Long id;

    /**
     * 节点KEY
     */
    private String key;

    /**
     * 节点名称
     */
    private String label;

    /**
     * 节点图标
     */
    private String icon;

    /**
     * 子节点
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeModel> children;

    public TreeModel() {

    }


    public TreeModel(Long id, String label, List<TreeModel> children) {
        this.id = id;
        this.label = label;
        this.children = children;
    }


    public TreeModel(Long id, String key, String label, String icon, List<TreeModel> children) {
        this.id = id;
        this.key = key;
        this.label = label;
        this.icon = icon;
        this.children = children;
    }
}
